import { MidwayHttpError } from '@midwayjs/core';

export function checkCode(cacheCode: any, code: any) {
  if (!cacheCode) {
    throw new MidwayHttpError('验证码已过期!', 500);
  } else if (!code || code.toLowerCase() !== cacheCode) {
    throw new MidwayHttpError('验证码错误!', 500);
  }
}
